package com.example.android.miwok;

/**
 * Created by Qinwen on 2017/9/17.
 */

public class Word {

    private static final int NO_IMAGE_PROVIDED = -1;
    private static final int NO_AUDIO_PROVIDED = -1;

    // Private String mMiworkTranslation
    private String mMiworkTranslation;
    // Private String mDefaultTranslation
    private String mDefaultTranslation;
    // Private int number ImageResourceId
    private int mImageResourceId = NO_IMAGE_PROVIDED;
    // Private int number AudioResourceId
    private int mAudioResourceId = NO_AUDIO_PROVIDED;

    // Constructs with initial values
    public Word(String MiworkTranslation, String DefaultTranslation) {
        mMiworkTranslation = MiworkTranslation;
        mDefaultTranslation = DefaultTranslation;
    }

    // Constructs with initial values
    public Word(String MiworkTranslation, String DefaultTranslation, int AudioResourceId) {
        mMiworkTranslation = MiworkTranslation;
        mDefaultTranslation = DefaultTranslation;
        mAudioResourceId = AudioResourceId;
    }

    // Constructs with initial values
    public Word(String MiworkTranslation, String DefaultTranslation, int ImageResourceId, int AudioResourceId) {
        mMiworkTranslation = MiworkTranslation;
        mDefaultTranslation = DefaultTranslation;
        mImageResourceId = ImageResourceId;
        mAudioResourceId = AudioResourceId;
    }

    // Get miTranslation
    public String getMiTranslation() {
        return mMiworkTranslation;
    }

    // Get defaultTranslation
    public String getDefaultTranslation() {
        return mDefaultTranslation;
    }

    // Get defaultTranslation
    public int getImageResourceId() {
        return mImageResourceId;
    }

    // Return if there is a image resource
    public boolean hasImage() {
        return mImageResourceId != NO_IMAGE_PROVIDED;
    }

    // Get defaultTranslation
    public int getAudioResourceId() {
        return mAudioResourceId;
    }

//    // Return if there is a image resource
//    public boolean hasAudio() {
//        return mAudioResourceId != NO_IMAGE_PROVIDED;
//    }


    /**
     * Returns the string representation of the {@link Word} object.
     */
    @Override
    public String toString() {
        return "Word{" +
                "mMiworkTranslation='" + mMiworkTranslation + '\'' +
                ", mDefaultTranslation='" + mDefaultTranslation + '\'' +
                ", mImageResourceId=" + mImageResourceId +
                ", mAudioResourceId=" + mAudioResourceId +
                '}';
    }

}
